
function calculate(no){
  let a = no/1024;
  if(a<1){
    return no+'B';
  }
  let b = a/1024;
  if(b<1){
    return Math.round(a*100)/100+'KB';
  }
  return Math.round(b*100)/100+'MB';
}

export default ({ list,type,onClick }) => (
  <div>
    {
      list.map((item,key) => (
           
                  <div key={key} className="dd-t-border t-P6 t-MB10" onClick={onClick.bind(null,item)}>
                           
                      <i className="iconfont icon-file t-FC9 t-FL t-MR6"></i>
                     
                      <div className="dd-t-list-text-content">
                          <div className="t-list-title t-omit t-LH1_4">                          
                             {type==1?item.fileDisplayName:'正文.doc'}
                          </div>
                          <div className={type==1?'dd-t-list-time t-FBAC':'t-DN'}>
                          {calculate(item.fileSize)}
                          </div>
                      </div>
                    </div>
        ))
    }
   </div> 
);
